<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .father {
            overflow: hidden;
            width: 300px;
            height: 300px;
            margin: 100px auto;
            background-color: pink;
            text-align: center;
        }

        .son {
            width: 200px;
            height: 200px;
            margin: 50px;
            background-color: purple;
            line-height: 200px;
            color: #fff;
        }
    </style>
</head>
<body>
<div class="father">
    <div class="son">son</div>
</div>
<script>
    var son = document.querySelector('.son');
    son.addEventListener('click', function (e) {
        alert('son');
        //阻止冒泡
        e.stopPropagation();//stop 停止 Propagation 传播
        e.cancelBubble = true;//cancel 取消 bubble泡泡
    }, false);
    var father = document.querySelector('.father');
    father.addEventListener('click', function (e) {
        alert('father');
        e.stopPropagation();
    }, false);
    document.addEventListener('click', function () {
        alert('document')
    });
</script>
</body>
</html>